package pojo;

import java.util.Date;

/**
 * 商品实体类
 * @author 周超
 */
public class Goods {

    private int goId;             //商品id
    private String goName;        //商品名称
    private int goSalesVolume;   //商品销量
    private int goPraise;        //商品评价
    private Date goUptime;       //上架时间
    private String goPictureUrl;//图片地址
    private String goDescribe;  //商品描述
    private int goCost;         //商品成本
    private int goPrice;        //商品价格
    private int goStock;        //商品库存
    private int goState;        //商品状态
    private String state;       //商品状态描述
    private int clId;           //商品所属分类id
    private String clName;      //商品所属分类名称
    private int goSecKill;     //商品是否参与秒杀
    private String secKill;       //商品是否参与秒杀描述

    @Override
    public String toString() {
        return "Goods{" +
                "goId=" + goId +
                ", goName='" + goName + '\'' +
                ", goSalesVolume=" + goSalesVolume +
                ", goPraise=" + goPraise +
                ", goUptime=" + goUptime +
                ", goPictureUrl='" + goPictureUrl + '\'' +
                ", goDescribe='" + goDescribe + '\'' +
                ", goCost=" + goCost +
                ", goPrice=" + goPrice +
                ", goStock=" + goStock +
                ", goState=" + goState +
                ", clId=" + clId +
                ", clName='" + clName + '\'' +
                ", goSecKill=" + goSecKill +
                '}';
    }

    public Goods() {
    }

    public Goods(int goId, String goName, int goSalesVolume,
                 int goPraise, Date goUptime, String goPictureUrl,
                 String goDescribe, int goCost, int goPrice, int goStock,
                 int goState, int clId, String clName, int goSecKill) {
        this.goId = goId;
        this.goName = goName;
        this.goSalesVolume = goSalesVolume;
        this.goPraise = goPraise;
        this.goUptime = goUptime;
        this.goPictureUrl = goPictureUrl;
        this.goDescribe = goDescribe;
        this.goCost = goCost;
        this.goPrice = goPrice;
        this.goStock = goStock;
        this.goState = goState;
        this.clId = clId;
        this.clName = clName;
        this.goSecKill = goSecKill;
    }

    public int getGoId() {
        return goId;
    }

    public void setGoId(int goId) {
        this.goId = goId;
    }

    public String getGoName() {
        return goName;
    }

    public void setGoName(String goName) {
        this.goName = goName;
    }

    public int getGoSalesVolume() {
        return goSalesVolume;
    }

    public void setGoSalesVolume(int goSalesVolume) {
        this.goSalesVolume = goSalesVolume;
    }

    public int getGoPraise() {
        return goPraise;
    }

    public void setGoPraise(int goPraise) {
        this.goPraise = goPraise;
    }

    public Date getGoUptime() {
        return goUptime;
    }

    public void setGoUptime(Date goUptime) {
        this.goUptime = goUptime;
    }

    public String getGoPictureUrl() {
        return goPictureUrl;
    }

    public void setGoPictureUrl(String goPictureUrl) {
        this.goPictureUrl = goPictureUrl;
    }

    public String getGoDescribe() {
        return goDescribe;
    }

    public void setGoDescribe(String goDescribe) {
        this.goDescribe = goDescribe;
    }

    public int getGoCost() {
        return goCost;
    }

    public void setGoCost(int goCost) {
        this.goCost = goCost;
    }

    public int getGoPrice() {
        return goPrice;
    }

    public void setGoPrice(int goPrice) {
        this.goPrice = goPrice;
    }

    public int getGoStock() {
        return goStock;
    }

    public void setGoStock(int goStock) {
        this.goStock = goStock;
    }

    public int getGoState() {
        return goState;
    }

    public void setGoState(int goState) {
        this.goState = goState;
    }

    public int getClId() {
        return clId;
    }

    public void setClId(int clId) {
        this.clId = clId;
    }

    public String getClName() {
        return clName;
    }

    public void setClName(String clName) {
        this.clName = clName;
    }

    public int getGoSecKill() {
        return goSecKill;
    }

    public void setGoSecKill(int goSecKill) {
        this.goSecKill = goSecKill;
    }

    public String getState() {
        return state;
    }

    public void setState() {

        if(getGoState()==0){
            this.state="已下架";
        }
        else{
            this.state="热卖中";
        }
    }

    public String getSecKill() {
        return secKill;
    }

    public void setSecKill() {

        if(getGoSecKill()==0){
            this.secKill="否";
        }
        else{
            this.secKill="是";
        }
    }
}


